﻿#ifndef CONNECTAPI_H
#define CONNECTAPI_H

#include <QWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QTextEdit>
#include <QLabel>
#include <QNetworkReply>
#include <QList>
#include <QJsonObject>
#include <QString>
class ContentWidget : public QWidget
{
    Q_OBJECT

public:
    ContentWidget(QWidget *parent = nullptr);
    ~ContentWidget();
    QString Text;
    void on_sendButton_clicked();
    void on_uploadImageButton_clicked(const QString &fileName);
    int FLAG_1_API_BACK_OK = 0;

private:
    void sendGeminiRequest();
    QJsonObject processImage(const QString& imagePath);
    QTextEdit *responseTextEdit;
    QList<QJsonObject> conversationHistory;
    QString selectedImagePath;
};

#endif // CONNECTAPI_H
